/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.dp.vo;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author wyr
 */
@Entity
@Table(name = "news_contenttype")
//@NamedQueries({@NamedQuery(name = "NewsContenttype.findAll", query = "SELECT n FROM NewsContenttype n"), @NamedQuery(name = "NewsContenttype.findByNewscontenttype", query = "SELECT n FROM NewsContenttype n WHERE n.newscontenttype = :newscontenttype"), @NamedQuery(name = "NewsContenttype.findByChannelId", query = "SELECT n FROM NewsContenttype n WHERE n.channelId = :channelId")})
public class NewsContenttype implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "newscontenttype")
    private String newscontenttype;
    @Column(name = "channel_id")
    private String channelId;
    @JoinColumn(name = "channelid", referencedColumnName = "channelid")
    @ManyToOne
    private NewsExtendsFirstchannel channelid;

    public NewsContenttype() {
    }

    public NewsContenttype(String newscontenttype) {
        this.newscontenttype = newscontenttype;
    }

    public String getNewscontenttype() {
        return newscontenttype;
    }

    public void setNewscontenttype(String newscontenttype) {
        this.newscontenttype = newscontenttype;
    }

    public String getChannelId() {
        return channelId;
    }

    public void setChannelId(String channelId) {
        this.channelId = channelId;
    }

    public NewsExtendsFirstchannel getChannelid() {
        return channelid;
    }

    public void setChannelid(NewsExtendsFirstchannel channelid) {
        this.channelid = channelid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (newscontenttype != null ? newscontenttype.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof NewsContenttype)) {
            return false;
        }
        NewsContenttype other = (NewsContenttype) object;
        if ((this.newscontenttype == null && other.newscontenttype != null) || (this.newscontenttype != null && !this.newscontenttype.equals(other.newscontenttype))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.dp.vo.NewsContenttype[newscontenttype=" + newscontenttype + "]";
    }

}
